

// pages/individual/individual.js
var app = getApp();
Page({
  data: {
    loginOK: false,
    nickName: '',
    userID:''
  },

  login(){
    
    wx.navigateTo({
      url: '/pages/login/login',
    })
  },
  SignUp(){
    wx.navigateTo({
      url: '/pages/index/index',
    })
  },
  logout(){

    wx.setStorageSync('user', null)
    let user = wx.getStorageSync('user', user)
    if(user && user.name)
    {
      this.setData({
        loginOK: true,
      })
    }
    else{
      this.setData({
        loginOK: false
      })
    }
  },
  versions(){
    wx.showToast({
      title: "当前版本：v1.0 alpha",
      icon:'none'
    })
  },
  memory(){
    wx.navigateTo({
      url: '/pages/memoryHome/memoryHome',
    })
  },
  onShow(){
    this.setData({
      nickName: app.globalData.nickname,
      userID: app.globalData.userID
    })
    // add
    console.log("当前局部变量",this.data.nickName)
    console.log("当前局部变量",this.data.userID)
    let user = wx.getStorageSync('user', user)
    if(user && user.name)
    {
      this.setData({
        loginOK: true,
      })
    }
    else{
      this.setData({
        loginOK: false
      })
    }
  }
 



})